package com.czr.vo;

import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;

/**
 * <p>
 * 帖子表
 * </p>
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="czr_post对象", description="帖子")
public class CzrPostVo extends Model<CzrPostVo> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键(不用传)")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "帖子标题")
    @NotEmpty(message = "帖子标题不能为空！")
    @TableField("title")
    private String title;

    @ApiModelProperty(value = "帖子正文")
    @NotEmpty(message = "帖子正文不能为空！")
    @TableField("content")
    private String content;

    @ApiModelProperty(value = "发帖时间(不用传)")
    @TableField("pub_time")
    private String pubTime;

//    @ApiModelProperty(value = "发帖人(不用传)")
//    @NotEmpty(message = "发帖人不能为空！")
//    @TableField("userId")
//    private Long userId;

    @ApiModelProperty(value = "阅读数(不用传)")
    @NotEmpty(message = "阅读数不能为空！")
    @TableField("reading_count")
    private Integer readingCount;

    @ApiModelProperty(value = "点赞数(不用传)")
    @NotEmpty(message = "点赞数不能为空！")
    @TableField("like_count")
    private Integer likeCount;

    @ApiModelProperty(value = "图片名称")
    private JSONArray image;

    @ApiModelProperty(value = "缩略图")
    @TableField("thumbnail")
    private String thumbnail;

    @ApiModelProperty(value = "栏目id")
    @TableField("columnId")
    private Integer columnId;

    @ApiModelProperty(value = "昵称")
    @TableField("nick_name")
    private String nickName;

    @ApiModelProperty(value = "头像")
    @TableField("user_logo")
    private String userLogo;

    @ApiModelProperty(value = "是否点赞")
    private Integer isLike;

    @ApiModelProperty(value = "下级数量")
    @TableField("postCount")
    private Integer postCount;

    @ApiModelProperty(value = "是否可以删除(0:不可以 1：可以)")
    @TableField("isDel")
    private Integer isDel;

    @ApiModelProperty(value = "帖子状态 0未审核 1审核完成 -1删除")
    @TableField("status")
    private Integer status;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
